﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace XGameFrame.Controls
{
    public class PictureBox : Control
    {
        #region Field Region
        #endregion

        #region Property Region
        #endregion

        #region Constructors

        public PictureBox(Texture2D pImage, Rectangle pDestination)
            :base(pImage,new Vector2(pDestination.X,pDestination.Y))
        {
            SourceRectangle = new Rectangle(0, 0, Texture.Width, Texture.Height);
            Color = Color.White;
        }

        #endregion

        #region Abstract Method Region

        public override void Update(GameTime gameTime)
        {
            
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Texture, Position, SourceRectangle, Color, Rotation, Origin,Scale, SpriteEffect, LayerDepth);
        }

        public override void HandleInput(PlayerIndex playerIndex)
        {

        }

        public override void OnHover(PlayerIndex playerIndex)
        {
        }

        #endregion

        #region Picture Box Methods

        public void SetPosition(Vector2 newPosition)
        {
            Position = new Vector2((int)newPosition.X,(int)newPosition.Y);
        }
        #endregion

    }
}
